﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using PloobsEngine.SceneControl;
using PloobsEngine.Modelo;
using PloobsEngine.Physics.Bepu;
using PloobsEngine.Material;
using PloobsEngine;

namespace Etapa1.ComercioEspacial
{
    [Serializable]
    public class ObjSerializer
    {
        public ObjSerializer()
        {
        }
        
        public String modelName;
        public String textureName;
        public  float raioDoCentroDoSistema;
        public  Vector3 posicaoInicialPLaneta ;        
        public  float speed;
        public Vector3 scale;

        public IObject GetObject()
        {
            SimpleModel sm = new SimpleModel(modelName, textureName);
            sm.LoadModelo();
            SphereObject pi = new SphereObject(posicaoInicialPLaneta, scale.X);                
            //GhostObject pi = new GhostObject(posicaoInicialPLaneta, Matrix.Identity, scale);
            CustomDeferred shader = new CustomDeferred(false, false, false, false);
            shader.Initialize();
            IMaterial mat = new Material(shader, MaterialType.DEFERRED);
            IObject obj3 = new SimpleObject(mat, pi, sm);

            MovimentacaoPlaneta mp = new MovimentacaoPlaneta();
            mp.raioDoCentroDoSistema =raioDoCentroDoSistema;
            mp.posicaoInicialPLaneta = posicaoInicialPLaneta;
            mp.representacaoPlaneta = obj3;
            mp.speed = speed;
            obj3.AddAtachment(mp);            

            return obj3;
        }

    }
}
